package com.cskaoyan.util;

import java.util.UUID;

/**
 * @Description:
 * @Author: WD created on 2021-09-15 22:18
 * @Version:
 */
public class UUIDUtil {
    public static String getUUID() {
        //生成16位uuid
        return UUID.randomUUID().toString().replace("-", "").toLowerCase().substring(0, 16);
    }

    public static String getUUID1() {
        //生成20位uuid
        return UUID.randomUUID().toString().replace("-", "").toLowerCase().substring(0, 21);
    }

    public static String getUUID6() {
        //生成6位uuid
        return UUID.randomUUID().toString().replace("-", "").toLowerCase().substring(0, 6);
    }


    /**
     * 生成优惠卷兑换码
     * @return
     */
    public static String getCouponUUID() {
        //生成12位uuid
        return UUID.randomUUID().toString().replace("-", "").toLowerCase().substring(0, 12);
    }
}
